﻿@namespace SwashbucklerDiary.Rcl.Components
@inherits CardComponentBase<DiaryModel>

<MCard Class="@($"diary-card elevation-sm-2--active {Class}")"
       OnClick="ToRead"
       Elevation="0"
       Ripple="false"
       Rounded="@("lg")">
    <MListItem Dense>
        <MListItemContent>
            <div class="d-flex align-center">
                <span class="text--secondary mr-3" style="font-size:1.1rem;">
                    @(Date)
                </span>
                @if (ShowIcon)
                {
                    <DiaryCardIcon Value="@weatherIcon" />
                    <DiaryCardIcon Value="@moodIcon" />
                }
            </div>
        </MListItemContent>
        <MListItemAction @onclick:stopPropagation="true">
            @if (Value.Top)
            {
                <MIcon>
                    mdi-format-vertical-align-top
                </MIcon>
            }

            <MButton @attributes="activatorAttributes"
                     Icon="true"
                     OnClick="OpenMenu">
                <MIcon Class="@($"chevron-down {(IsActive && ShowMenu?"chevron-down-rotate-x":"")}")">
                    mdi-chevron-down
                </MIcon>
            </MButton>
        </MListItemAction>
    </MListItem>
    <MDivider Class="mx-3"></MDivider>
    <MListItem ThreeLine>
        <MListItemContent>
            <div class="diary-card-title">
                @title
            </div>
            <MListItemSubtitle>
                @text
            </MListItemSubtitle>
        </MListItemContent>
    </MListItem>
</MCard>
